package com.sftz.modules.minapp.educationTypeCourse.module;

import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;

import com.sftz.modules.minapp.educationTypeCourse.service.CourseEduService;

@At("/wx/educationType")
@IocBean
@Filters
public class EducationTypeCourseModule {

	@Inject
	private CourseEduService courseEduService;

	/**
	 * @author   DuKL
	 * @Date	 2018年12月12日
	 * (effect:学历课程)
	 */
	@At
	@Ok("json")
	public Object queryEducationCourse(@Param("searchPageNum") final Integer searchPageNum,
			@Param("callbackcount") final Integer callbackcount) {
		return courseEduService.queryEducationCourse(searchPageNum, callbackcount);
	}

	/**
	 * @author   DuKL
	 * @Date	 2018年12月12日
	 * (effect:非学历课程)
	 */
	@At
	@Ok("json")
	public Object queryNotEducationCourse(@Param("searchPageNum") final Integer searchPageNum,
			@Param("callbackcount") final Integer callbackcount) {
		return courseEduService.queryNotEducationCourse(searchPageNum, callbackcount);
	}

	@At
	@Ok("json")
	public Object queryPageCourse(@Param("typeId") final Integer typeId,
			@Param("searchPageNum") final Integer searchPageNum, @Param("callbackcount") final Integer callbackcount) {
		if (typeId == 1) {
			return courseEduService.queryEducationCourse(searchPageNum, callbackcount);
		} else {
			return courseEduService.queryNotEducationCourse(searchPageNum, callbackcount);
		}
	}

}